<?php

/**
 * @author Vince Loremia 
 * @copyright 2008
 */

class JumpsiteDisplayInThumbnails extends Zend_Db_Table
{
	private $db;
    
    public function __construct()
    {
        $this->db= Zend_Registry::get('db');
    }
	
	public function getGroupWithAvatarLimit9()
    {
        $select = new Zend_Db_Select($this->db);
        $select
		->from (array('profile' => 'group_profile'),
		array ('profid' => 'profile.id', 'name', 'profDescription' =>'profile.description', 'access', 'avatar' => 'avatar.filename', 'avatarWidth' => 'avatar.width', 'avatarHeight' => 'avatar.height'))
		->join(array('avatar' => 'group_avatar'), 'avatar_id = avatar.id')
        ->order(array('profile.id DESC'))
        ->limit(0, 9);
        $stmt = $select->query();
        $result = $stmt->fetchAll();
        return $result;
        
/* This sql
SELECT profile.id, name, description, access, avatar.filename, avatar.width, avatar.height
FROM group_profile AS profile JOIN group_avatar AS avatar
ON avatar_id = avatar.id
GROUP BY profile.id
order by id desc
limit 0,9
*/
    }
}


?>